﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ISupportTicket>" %>

<asp:Content ID="Content3" ContentPlaceHolderID="JSContent" runat="server">
 <script type="text/javascript" src="/Scripts/jquery-1.4.3.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("form").submit(function () {
                try {
                    $.post(
                    $(this).attr("action"),
                    $(this).serialize(),
                    function (rspData, status, xhr) {
                        if (!rspData.Message) {
                            window.location.href = window.location.href;
                        }
                        else {
                            alert(rspData.Message);
                        }
                    },
                    "json");
                } catch (ex) {
                    alert(ex);
                }
                return false;
            });

        });
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%: Html.Partial("Sidebar") %>
    <div id="main">
        <div class="main-block">
            <h2 class="title">
                <%:"Support Ticket".Localize() %></h2>
            <div class="main-block-content clearfix">
                <div class="tabs">
                    <a href="<%= this.ViewData["ProfileLinks"].Bind("Profile") %>">
                        <%:"Account Info".Localize() %></a> <a href="<%= this.ViewData["ProfileLinks"].Bind("Password") %>">
                            <%:"Change Password".Localize() %></a> <a href="<%= this.ViewData["ProfileLinks"].Bind("Address") %>">
                                <%:"Address Lists".Localize() %></a> <a href="<%= this.ViewData["ProfileLinks"].Bind("Order") %>">
                                    <%:"My Orders".Localize() %></a> <a class="current" href="<%= this.ViewData["ProfileLinks"].Bind("SupportTicket") %>">
                                        <%:"Support Ticket".Localize() %></a>
                </div>
                <div class="tab-content">
                    <div class="support-block">
                        <div class="support-info">
                            <h4 class="title">
                                <%: this.Model.Subject
                                %></h4>
                            <span class="date">
                                <%: this.Model.CreateDate.ToString() %></span><div>
                                    <%:"Status:".Localize() %><%: this.Model.Status %>
                                </div>
                        </div>
                        <p>
                            <%: this.Model.Body %></p>
                    </div>
                    <%
                        foreach (var item in this.Model.SupportReplies)
                        {
                    %>
                    <div class="support-block admin-block">
                        <div class="support-info">
                            <h5 class="title">
                                <%: item.Subject %>
                            </h5>
                            <span class="author">
                                <%: item.UserName %></span> <span class="date">
                                    <%: item.CreateDate.ToString() %></span>
                        </div>
                        <p>
                            <%: item.Body %></p>
                    </div>
                    <%
                        }
                    %>
                    <div class="common-form support-form">
                        <form method="post" action="<%: this.Url.Action("SupprotTicketDetial", new { id=this.Model.Id}) %>">
                        <fieldset>
                            <p>
                                <strong>
                                    <%:"Reply".Localize() %></strong></p>
                            <p>
                                <label for="subject">
                                    <%:"Subject".Localize() %></label>
                                <input type="text" id="subject" name="Subject" class="long" value="<%:"Re:".Localize() %><%: this.Model.Subject %>">
                            </p>
                            <p>
                                <label for="email">
                                    <%:"Email:".Localize() %></label>
                                <input type="text" id="Email" name="Email" value="<%: this.ViewBag.CustomerEmail %>">
                            </p>
                            <p>
                                <label for="content">
                                    <%:"Content".Localize() %></label>
                                <textarea id="content" name="Body" rows="6" style="width: 100%;"></textarea>
                            </p>
                        </fieldset>
                        <fieldset class="buttons">
                            <button class="button" type="submit">
                                <span>
                                    <%:"Reply".Localize() %></span></button>
                            <button class="button" type="reset">
                                <span>
                                    <%:"Cancel".Localize() %></span></button>
                        </fieldset>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Breadcrumb" runat="server">
    <ul class="breadcrumb">
        <li><a href="/">
            <%:"Home".Localize() %></a>&gt;</li>
        <li><a href="/my">
            <%:"Account".Localize() %></a>&gt;</li>
        <li>
            <%:"Orders".Localize() %></li>
    </ul>
</asp:Content>
